package com.alquimia.identityaccess.rest.controller.fixture;


import com.alquimia.identityaccess.application.events.user.*;

import static com.alquimia.identityaccess.rest.controller.fixture.UserDataFixture.customUser;
import static com.alquimia.identityaccess.rest.controller.fixture.UserDataFixture.customUserEmailAddress;
import static com.alquimia.identityaccess.rest.controller.fixture.UserDataFixture.customUserEvent;

/**
 * Created by Ivo on 15/07/2014.
 */
public class RestEventFixture {

    public static UserEvent userNotFound(String aUserId) {
        return UserEvent.notFound(aUserId);
    }

    public static UserEvent userEvent(String aUserId) {
        return customUserEvent();
    }

    public static UserRegisteredEvent userRegistered() {
        return new UserRegisteredEvent(customUser());
    }

    public static UserPersonalNameUpdatedEvent userPersonalNameUpdated(String aFirstName, String aLastName) {
        return new UserPersonalNameUpdatedEvent(UserDataFixture.customUserFullName(aFirstName, aLastName));
    }

    public static UserEmailAddressUpdatedEvent userEmailAddressUpdated(String aEmailAddress) {
        return new UserEmailAddressUpdatedEvent(customUserEmailAddress(aEmailAddress));
    }

    public static UserPasswordUpdatedEvent userPasswordUpdated(String aChangedPassword) {

        return new UserPasswordUpdatedEvent(UserDataFixture.customUserPassword(aChangedPassword));
    }

    public static UserAuthenticatedEvent userAuthenticated(String aUsername, String aPassword){
        return new UserAuthenticatedEvent(customUser());
    }

    public static UserAuthenticatedEvent userAuthenticatedNotFound(String aUsername, String aPassword){
        return UserAuthenticatedEvent.notFound(aUsername);
    }
}
